package cc.linker.steplink.crm.merchant.dao.acs;

import cc.linker.steplink.crm.merchant.pojo.*;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

public interface XbMerchantMapper {

    Map<String,Object> getShopInfo(@Param(value = "adminId") String adminId);

    Integer setShopInfo(Map<String, Object> params);

    Integer addVerify(Map<String, Object> params);

    BindBankInfoPo getBindBankInfo(@Param(value = "orgId") String orgId,@Param(value = "type") String type,@Param(value = "customerId") String customerId);

    Map<String, Object> getWithdrawLimit(String orgId);

    void insertWithdrawDetail(Map<String, Object> map);

    void insertWithdrawFeeDetail(Map<String, Object> map);

    CustomerAccountPo getCustomerAccount(Map<String, String> map);

    List<TransactionDetailsPo> getTransactionDetails(Map<String, Object> params);

    List<Map<String, Object>> listAcsSalerIds();

    Integer ifSummaryStatisticsSaler(Map<String, Object> map);

    void accountSummaryStatisticsSaler0(Map<String, Object> map);

    void updateSummaryStatisticsSaler(Map<String, Object> map);

    List<AccountSummaryPo> getAccountSummarySalerByDay(Map<String, Object> params);

    List<AccountSummaryPo> getAccountSummarySalerByMonth(Map<String, Object> params);

    void updateXbBalance(@Param("withdrawAmount") Long withdrawAmount,@Param("customerId") String customerId);

    void updateOrgBalance(@Param("withdrawAmount") Long withdrawAmount,@Param("orgId") String orgId);

    Map<String, Object> getXbAccountInfo(@Param("customerId") String customerId);

    Map<String,Object> getOrgAccountInfo(@Param("orgId") String orgId);

    Map<String, Object> getDmAccountInfo(String orgId);

    List<UserAccountPo> selectUnfreezeUserList();

    List<UserAccountPo> selectUnfreezeUserListPay();

    void updateOrgAccountInfoByOrgId(UserAccountPo userAccountPo);

    void reduceOrgAccountInfoByOrgId(UserAccountPo userAccountPo);

    void updateAccountInfoByCid(UserAccountPo userAccountPo);

    void bindBankInfo(Map<String, Object> params);

    void updateBindBankInfo(Map<String, Object> map);

    void insertWithdrawRecord(Map<String, Object> map);

    Integer ifExistWithdraw(Map<String, String> map);

    Integer ifSummaryStatistics(Map<String, Object> map);

    void accountSummaryStatistics(Map<String, Object> map);

    void updateSummaryStatistics(Map<String, Object> map);

    List<AccountSummaryPo> getAccountSummaryByDay(Map<String, Object> params);

    List<AccountSummaryPo> getAccountSummaryByMonth(Map<String, Object> params);

    void updateXbAccountInfoByCid(UserAccountPo userAccountPo);

    void reduceXbAccountInfoByCid(UserAccountPo userAccountPo);

    CustomerAccountPo getLinkerAccountInfo(String customerId);

    /**
     * 获取所有大b余额
     */
    List<Map<String, Object>> getBalanceEachOrg();

    /**
     * 批量插入机构余额
     */
    void insertBatchOrgBalance(List<Map<String, Object>> list);

    /**
     * 获取所有小b余额
     */
    List<Map<String, Object>> getBalanceEachSales();

    /**
     * 通过日期和id查起始余额、结束余额、冻结
     */
    Map<String, Object> getBalanceByDateAndCustomerId(Map<String, Object> map);

    /**
     * 查本期结余
     */
    Map<String, Object> getEndBalance(Map<String, Object> map);

    /**
     * 获取收入和支出
     */
    Map<String, Object> getIncomeAndExpenditure(Map<String, Object> map);

    /**
     * 获取收入（按类型分组）
     */
    List<Map<String, Object>> getIncomeOverTime(Map<String, Object> map);

    /**
     * 获取支出（按类型分组）
     */
    List<Map<String, Object>> getExpenditureOverTime(Map<String, Object> map);

    /**
     * 获取商家名称
     */
    String getShopName(Map<String, Object> map);

    /**
     * 通过cas的adminId查小b的引导信息
     */
    Map<String, Object> getShopGuideInfoByAdminId(Map<String, Object> map);

    /**
     * 按日期获取积分解冻列表
     */
    List<UserAccountPo> selectUnfreezeScoreUserList();

    /**
     * 解冻积分
     */
    void unfreezeScoreByCid(UserAccountPo userAccountPo);

    /**
     * 把账单状态置为已解冻
     */
    void updateTradeInfoThawStatus(String ids);

    /**
     * 把账单状态置为已解冻(积分)
     */
    void updateTradeScoreInfoThawStatus(String ids);

    /**
     * 推广员解冻
     */
    void updateAgentAccountInfoByCid(UserAccountPo userAccountPo);

    /**
     * 根据admin获取企业资质
     */
    String getMerchantStatusByAdminId(String adminId);

    /**
     * 设置小b是否显示引导页
     */
    void displayGuide(Map<String, Object> map);

    String getMerchantId(@Param("type") String type,@Param("customerId")  String customerId,@Param("orgId")  String orgId);

    Integer checkWithDraw(Map<String, Object> param);

    String getDongCustomerIdByUserId(String userId);

    List<Map<String, Object>> listDongSalerIds();

    List<Map<String, Object>> tradeList(Map<String, Object> params);

    Map<String, Object> getOrderInfo(@Param("orderSn") String orderSn,@Param("protectId") String protectId);

    List<Map<String, Object>> tradeListFreeze(Map<String, Object> params);

    List<UserAccountPo> selectUnfreezeUserListByOrderSn(String orderSn);

    List<UserAccountPo> selectUnfreezeScoreUserListByOrderSn(String orderSn);

    String getShopNameAndLogo(Map<String, Object> map);

}
